﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Andy.Web.admin
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btDangNhap_Click(object sender, EventArgs e)
        {
            using (var ndService = new NguoiDungServiceReference.NguoiDungServiceClient())
            {
                var result = ndService.Login(txtTaiKhoan.Text, txtMatKhau.Text);
                if (result != null)
                {
                    
                        Session["nsd"] = result;
                        Response.Redirect("~/admin/ht_qlsp.aspx");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Redit", "alert('Tài khoản hoặc mật khẩu sai !'); window.location='" + Request.ApplicationPath + "admin/Default.aspx';", true);
                }
            }
        }
    }
}